import java.util.Random;
import java.util.Scanner;
import java.util.concurrent.ScheduledExecutorService;


/**
 * Created with IntelliJ IDEA.
 * Description:BOKD
 * User: 34321
 * Date: 2024-11-01
 * Time: 10:39
 */
public class Test {

    public static void main3(String[] args) {
        Random rondom = new Random();
        Scanner sc = new Scanner(System.in);
        int toGuess =rondom.nextInt(100);
        System.out.println("toGuess"+toGuess);
        while(true){
            System.out.println("请输入你猜的数字");
            int num = sc.nextInt();
            if(num < toGuess){
                System.out.println("你猜小了");
            }else if(num > toGuess){
                System.out.println("你猜大了");
            }else{
                System.out.println("恭喜你猜对了");
                break;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = 0;
        int sum = 0;
        while(sc.hasNextInt()){
            int tmp = sc.nextInt();
            sum += tmp;
            num++;
        }
        System.out.println("sum:"+sum);
        System.out.println("avg:"+sum/num);
        sc.close();
    }

    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入您的年龄：");
        int age =sc.nextInt();
        System.out.println("请输入您的工资：");
        float salary = sc.nextFloat();
        System.out.println("您的信息如下：");
        System.out.println("name:"+name+"age:"+age+"salary:"+salary);
        sc.close();//记得调用关闭方法
    }
}
